home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Day Cry
/
Day Cry CD.bin
/
oh_towns
/
taropyon
/
silib
/
silib.lzh
/
PRG
/
SDKFS
/
SDKFS.C
< prev
next >
Wrap
C/C++ Source or Header
|
1994-05-18
|
3KB
|
156 lines
/*************************************************************************
* SDKFS : Sidework file selector ver.2.01a
* with system ügPirdeühversion III
*-------------------------------------------------------------------------
*************************************************************************/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <fmcfrb.h>
#include <sidework.h>
#include <egb.h>
#include <mos.h>
#include <kkstr2.h>
#include <siapl.h>
#include <silib.h>
#include <sisdk.h>
#include <sifs.h>
#include "sdkfs.h"
#include "sdkfscf.h"
static int FlgDirSave = FALSE;
static char set24 = FALSE;
static int init(void)
{
int scnmd = 12, pageMos = 0, pageKb = 0;
if ( SDK_init() )
return (ERR);
SI_init();
KB_initSet(pageKb,KAN_ROUMAZIOFF);
if ( SCN_init(scnmd) )
return (ERR);
switch ( SiScn->layerCrt->pixel )
{
case 4:
C_LGRAY = 5;
C_MBLACK = 1;
break;
case 8:
C_LGRAY = 17;
C_MBLACK = 0;
break;
}
SCN_setSysPalette();
pageMos = SiScn->pgWrt;
if ( FlgSdkOn )
pageKb = pageMos = SiScn->pgWrt;
else
{
SI_set24h();
SI_setCtrlC();
set24 = TRUE;
}
FTS_init();
// if ( FTS_fnt16x16_init() == NORMAL ) SiFts->ftsSt2 = Fnt16x16;
// if ( FTS_fnt16x12_init() == NORMAL ) SiFts->ftsSl2 = Fnt16x12;
// if ( FTS_fnt16x08_init() == NORMAL ) SiFts->ftsSh2 = Fnt16x08;
// if ( FTS_fnt12x12_init() == NORMAL ) SiFts->ftsSs2 = Fnt12x12;
PD_init(0,pageMos); /* â|âCâôâeâBâôâOâfâoâCâXâëâCâuâëâè */
KB_init(pageKb,0); /* âLü[â{ü[âhâëâCâuâëâè */
KB_kanDsp(0);
EV_init(); /* âCâxâôâgâëâCâuâëâè */
return (NORMAL);
}
static void term(void)
{
if ( set24 )
SI_reset24h();
EV_term();
PD_term();
KB_term();
// FTS_fnt16x12_term();
// FTS_fnt16x16_term();
FTS_term();
SCN_sysTerm();
SI_term();
SDK_term();
}
int main(int argc, char **argv)
{
FILESEL_T *fs;
int ret = 1;
char *fn, *wild = NULL;
char *dirSave;
if ( init() )
goto _RET;
{
int i;
for ( i = 1; i < argc; ++i )
{
char *s;
s = argv[i];
if ( *s == '/' || *s == '-' )
{
++s;
if ( strcmpi(s,"d") == 0 )
FlgDirSave = TRUE;
++s;
} else if ( wild == NULL )
wild = s;
}
}
{ /* âüâéâèâ`âFâbâN */
char *ptr;
LAYER_T *ly = SiScn->layerCrt;
if ( (ptr = SI_MALLOC( 4096 + (FSDLG_XS * ly->pixel/8) * FSDLG_YS)) == NULL )
goto _RET;
SI_FREE(ptr);
}
if ( FlgDirSave )
dirSave = FS_pushDir();
if ( (fs = FileSel_open()) != NULL )
{
FileSel_setTitle( fs, "SDKFS ver.%s", _SDKFS_VER );
if ( wild )
FileSel_setWild( fs, wild );
if ( FileSel_start(fs) == NORMAL )
{ /* É│ÅφÅIù╣ */
fn = FileSel_getFn( fs );
ret = 0;
if ( FlgSdkOn )
{ /* âLü[âoâbâtâ@é╓é╠ò╢ÄÜù±üiâtâ@âCâïû╝üjô]æù */
FS_dosFn( fn, fn );
sdk_setKBuf( fn );
}
}
FileSel_close(fs);
}
if ( FlgDirSave )
FS_popDir(dirSave);
_RET:
term();
return (ret);
}